<?php
require_once("includes/inform.tbl.php");
require_once("viewinfo.php");

$id = $_REQUEST["id"];
if($id > 0)
{
	$pClsInform = new clsInformTable($id);
	$title = $pClsInform->value('title');
	$content = $pClsInform->value('content');
	$listinform = $pClsInform->listobj(10);
	$arr_link = array();
	foreach($listinform as $pClsInform)
	{
		if($pClsInform->value('id') != $id)
		{
			$arr_link[$pClsInform->value('title')] = "?page=inform&id=".$pClsInform->value('id');
		}
	}
	view_info1($title, $content, "Các các thông báo khác", $arr_link );
}
else
{
	$title = "Thông báo";
	$pClsInform = new clsInformTable();
	$listinform = $pClsInform->listobj(10);
	view_list_inform($title, $listinform);
}	
?>